package com.corpdata.dao;

import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Qualifier;

import com.corpdata.entity.OrgUser;
import com.github.pagehelper.Page;

@Mapper
public interface OrgUserMapper {
	
	@Qualifier("clusterDataSource")
	@Select("select *  from org_user ")
	Page<OrgUser> selectAll();
	
	int create(OrgUser user);
	
	int delete(String id);
	
	int update(OrgUser user);
	
	@Select("select * from org_user where userid=#{userId}")
	OrgUser login(@Param("userId") String userId);
	
	@Select("select table_name tableName, engine, table_comment tableComment, create_time createTime from information_schema.tables "
			+ "	where table_schema = (select database()) and table_name = 'org_user'")
	Map<String, Object> get();
}
